#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/569/learning/");
	int a, b, sum = 0, day = 0;
	for (int i = 1; i <= 7; i++) {
		cin >> a >> b;
		if (a + b > sum) {
			sum = a + b;
			day = i;
		}
	}
	cout << day;
	return 0;
}
